package com.liujg.future.mapper;

import com.liujg.future.model.entity.Cart;
import org.springframework.data.mongodb.repository.DeleteQuery;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

public interface CartRepository extends MongoRepository<Cart, String> {


    List<Cart> findByUserIdAndBuyStatus(String userId, Boolean aFalse);

    @DeleteQuery("{ 'userId' : ?0, 'skuId' : { $in : ?1 } }")
    void deleteByUserIdAndSkuIdIn(String userId, List<String> skuIds);



    List<Cart> findByUserIdAndBuyStatusAndSkuId(String userId, Boolean aFalse, String skuId);
}
